import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '社区名称',
    align: "center",
    dataIndex: 'communityName_dictText'
  },
  {
    title: '房产编号',
    align: "center",
    dataIndex: 'propertyNumber'
  },
  {
    title: '业主姓名',
    align: "center",
    dataIndex: 'ownerName'
  },
  {
    title: '装修保证金-收取',
    align: "center",
    dataIndex: 'depositCollection'
  },
  {
    title: '收取日期',
    align: "center",
    dataIndex: 'collectionDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
  },
  {
    title: '退还日期',
    align: "center",
    dataIndex: 'returnDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
  },
  {
    title: '装修保证金-推取',
    align: "center",
    dataIndex: 'tuibaozhengjin'
  },
  {
    title: '退去日期',
    align: "center",
    dataIndex: 'tuidate'
  },
  // {
  //   title: '创建方式',
  //   align: "center",
  //   dataIndex: 'createType'
  // },
  // {
  //   title: '创建人',
  //   align: "center",
  //   dataIndex: 'createBy'
  // },
  // {
  //   title: '更新人',
  //   align: "center",
  //   dataIndex: 'updateBy'
  // },
  // {
  //   title: '最后一次更新日期',
  //   align: "center",
  //   dataIndex: 'updateTime'
  // },

];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "社区名称",
    field: 'communityName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "房产编号",
    field: 'propertyNumber',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "业主姓名",
    field: 'ownerName',
    component: 'Input',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '社区名称',
    field: 'communityName',
    component: 'Input',
  },
  {
    label: '房产编号',
    field: 'propertyNumber',
    component: 'Input',
  },
  {
    label: '业主姓名',
    field: 'ownerName',
    component: 'Input',
  },
  {
    label: '装修保证金-收取',
    field: 'depositCollection',
    component: 'InputNumber',
  },
  {
    label: '收取日期',
    field: 'collectionDate',
    component: 'DatePicker',
  },
  {
    label: '退还日期',
    field: 'returnDate',
    component: 'DatePicker',
  },
  {
    label: '创建方式',
    field: 'createType',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  communityName: {title: '社区名称',order: 0,view: 'text', type: 'string',},
  propertyNumber: {title: '房产编号',order: 1,view: 'text', type: 'string',},
  ownerName: {title: '业主姓名',order: 2,view: 'text', type: 'string',},
  depositCollection: {title: '装修保证金-收取',order: 3,view: 'number', type: 'number',},
  collectionDate: {title: '收取日期',order: 4,view: 'date', type: 'string',},
  returnDate: {title: '退还日期',order: 5,view: 'date', type: 'string',},
  createType: {title: '创建方式',order: 6,view: 'text', type: 'string',},
  createBy: {title: '创建人',order: 7,view: 'text', type: 'string',},
  updateBy: {title: '更新人',order: 8,view: 'text', type: 'string',},
  updateTime: {title: '最后一次更新日期',order: 9,view: 'datetime', type: 'string',},
};
